package com.lzhsite.technology.designPattern.decorate.AOPDemo;

public class CheckDecorator extends Decorator
{
    public CheckDecorator(GoodsSaleEbi ebi)
    {
        super(ebi);
    }

    public boolean sale(String user, String customer, SaleModel saleModel)
    {
        if (!"张A".equals(user))
        {
            System.out.println("对不起" + user + "，你没有保存销售单的权限");
            return false;
        } else
        {
            return this.ebi.sale(user, customer, saleModel);
        }
    }
}
